<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改密码</title>
    <meta name="context-path" th:content="@{/}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/bootstrap.min.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/bootstrap-responsive.min.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/colorpicker.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/datepicker.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/uniform.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/select2.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-style.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-media.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-full.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/font-awesome/css/font-awesome.css}"/>
    <link rel="stylesheet" th:href="@{/resources/valid/css/bootstrapValidator.css}"/>
    <link rel="stylesheet" th:href="@{/resources/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/resources/css/website.css}"/>
</head>
<body class="childbody">
<div class="container-fluid editform_fluid">
    <!--Chart-box-->
    <div class="row-fluid">
        <div class="widget-box">
            <div class="widget-title"><span class="icon"> <i class="icon-align-justify"></i> </span>
                <h5>用户</h5>
            </div>
            <div class="widget-content">
                <form id="detailform" class="form-horizontal" th:object="${entity}">
                    <input type="hidden" id="id" name="id" th:value="*{id}"/>
                    <div class="control-group">
                        <label class="control-label">输入原密码 :</label>
                        <div class="controls  form-group">
                            <input type="password" name="oldPassword" id="oldPassword" class="span11 form-control"
                                   placeholder="请输入原密码">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">输入新密码 :</label>
                        <div class="controls  form-group">
                            <input type="password" name="password"  id="password" class="span11 form-control" placeholder="请输入新密码">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">再次输入新密码：</label>
                        <div class="controls form-group">
                            <input type="password" name="newPassword" id="newPassword"   class="span11 form-control" placeholder="请再次输入新密码">
                        </div>
                    </div>
                    <div class="form-actions">
                        <button id="btnSubmit" type="button" class="btn btn-success">确定</button>
                        <button id="btnClose" type="button" class="btn btn-primary">关闭</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/resources/js/jquery.min.js}"></script>
<script th:src="@{/resources/js/jquery-migrate-1.2.1.js}"></script>
<script th:src="@{/resources/matrix/js/jquery.ui.custom.js}"></script>
<script th:src="@{/resources/matrix/js/bootstrap.min.js}"></script>
<script th:src="@{/resources/matrix/js/bootstrap-colorpicker.js}"></script>
<script th:src="@{/resources/matrix/js/bootstrap-datepicker.js}"></script>
<script th:src="@{/resources/matrix/js/masked.js}"></script>
<script th:src="@{/resources/matrix/js/jquery.uniform.js}"></script>
<script th:src="@{/resources/matrix/js/select2.min.js}"></script>
<script th:src="@{/resources/matrix/js/matrix.js}"></script>
<script th:src="@{/resources/matrix/js/jquery.peity.min.js}"></script>
<script th:src="@{/resources/layui/layui.all.js}" charset="utf-8"></script>
<script th:src="@{/resources/valid/js/bootstrapValidator.js}"></script>
<script th:src="@{/resources/valid/js/language/zh_CN.js}"></script>
<script th:src="@{/resources/js/website.js}"></script>
<script th:src="@{/resources/js/system.js}"></script>
<script th:src="@{/resources/js/validation_fields.js}"></script>
<script th:inline="javascript">
    var contextRoot = $("meta[name='context-path']").attr("content");
</script>

<script th:inline="javascript">
    /*<![CDATA[*/
    layui.use(['form', 'layer', 'table'], function () {
        var formEdit = new FormEdit2(layui.form, layui.layer, parent.edit, {
            url: contextRoot + "author_manage/user/doUpdatePassword",
            getData: function () {
                return $("#detailform").serializeArray();
            }
        }, "detailform", ValidFields.user.update);
        $("#btnSubmit").bind("click", function (event) {
            var password = $("#password").val();
            var newPassword = $("#newPassword").val();
            if(password == newPassword){
                formEdit.submit();
            }else{
                layer.msg("两次输入的新密码不一致");
            }

        });
        $("#btnClose").bind("click", function (event) {
            formEdit.close();
        });
    });
    /*]]>*/
</script>
</body>
</html>